import { ref } from "vue";

export function useCount() {
  const count = ref(0);

  const add = (payload: number = 1): void => {
    count.value += payload;
  };

  const dec = (payload: number = 1): void => {
    count.value -= payload;
  };

  return {
    count,
    add,
    dec,
  };
}
